<template>
	<view class="card" @click="click">
		<view class="title">
			<view class="" style=" width:622rpx; display: flex;justify-content: space-between;">
				<view class="name">{{myInfo.title}}</view>
				<text style="font-size:26rpx ;color:#2E73FC;"> 上报进度 {{ Math.ceil(myInfo.progress*100) }}% </text>
			</view>
		</view>
		<view class="type">
			<view class="left">经办人</view>
			<view>{{myInfo.handle_name}}</view>
		</view>
		<view class="type">
			<view class="left">建设单位</view>
			<view>{{myInfo.department}}</view>
		</view>
		<view class="type">
			<view class="left">审查人</view>
			<view v-if="myInfo.audit_name.length==1">{{myInfo.audit_name[0]}}</view>
			<view v-if="myInfo.audit_name.length==2">{{myInfo.audit_name[0]}},{{myInfo.audit_name[1]}}</view>
			<view v-if="myInfo.audit_name.length>2">{{myInfo.audit_name[0]}},{{myInfo.audit_name[1]}}等{{myInfo.audit_name.length}}人</view>
		</view>
		<view class="type">
			<view class="left">开始时间</view>
			<view>{{myInfo.created_at | timeFormat('YYYY-MM-DD HH:mm')}}</view>
		</view>
		<view class="type" v-if="myInfo.state !== 'ing'">
			<view class="left">结束时间</view>
			<view>{{myInfo.end_time | timeFormat('YYYY-MM-DD HH:mm')}}</view>
		</view>
		<image class="img" v-if="myInfo.state=='ing'&& myInfo.yellow_audit"  src="@/static/image/prevention/dsh.png">
		</image>
		<image class="img" v-if="myInfo.state=='end'&& myInfo.flag" src="@/static/image/prevention/zgtg.png"></image>
		<image class="img" v-if="myInfo.state=='end'&& !myInfo.flag" src="@/static/image/prevention/hg.png"></image>
	</view>
</template>

<script>
	export default {
		name: 'XbdProjectReportCard',
		props: {
			myInfo: '',
		},
		data() {
			return {
				value: ""
			}
		},
		methods: {
			click() {
				uni.navigateTo({
					url: `/pages/prevent/project/details?id=${this.myInfo._id}`,
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.card {
		position: relative;
		// display: flex;
		padding: 40rpx 0;
		border-bottom: 2rpx dashed #E5E5E5;
		font-size: 26rpx;
		color: #A0A7B8;

		.img {
			position: absolute;
			width: 156rpx;
			height: 62rpx;
			top: 170rpx;
			right: 30rpx;
		}

		.type {
			font-size: 28rpx;
			display: flex;
			color: #000623;
			margin-bottom: 20rpx;
			font-weight: 400;

			.left {
				color: #A0A7B8;
				width: 130rpx;
				margin-right: 20rpx;
			}
		}

		.title {
			display: flex;
			color: #000623;
			font-size: 30rpx;
			margin-bottom: 32rpx;
			.name{
				width: 400rpx;
				overflow: hidden; 
				white-space: nowrap; 
				text-overflow: ellipsis;

			}
		}

		&:nth-last-child(1) {
			border-bottom: none;
		}
	}
</style>
